<template>
  <el-card class="box-card">
    <div slot="header" class="clearfix">
      <my-bread :level1="'权限管理'" :level2="'权限列表'" />
    </div>
    <el-table :data="rightList" border style="width: 100%" height="750">
      <el-table-column type="index" width="80" align="center"></el-table-column>
      <el-table-column prop="authName" label="权限名称"></el-table-column>
      <el-table-column prop="path" label="路径"></el-table-column>
      <el-table-column prop="level" label="层级">
        <template slot-scope="scope">
          <span v-if="scope.row.level ==='0'">一级</span>
          <span v-if="scope.row.level ==='1'">二级</span>
          <span v-if="scope.row.level ==='2'">三级</span>
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>
<script>
export default {
  data() {
    return {
      rightList: []
    };
  },
  created() {
    this.getRightList();
  },
  methods: {
    async getRightList() {
      const res = await this.$axios.get(`rights/list`);
      this.rightList = res.data.data;
    }
  }
};
</script>

